package a.f.d.a;

import a.c.ab;
import a.c.e;
import a.c.v;
import a.c.w;
import a.c.z;
import a.f.cd;
import a.f.o;
import a.i.l;

import java.util.ArrayList;
import java.util.Comparator;

public class u
  implements lc
{
  private k a;
  private cb b;
  private double d = 0.5D;
  public static boolean e;
  
  void a(k paramk)
  {
    this.a = paramk;
  }
  
  void a(cb paramcb)
  {
    this.b = paramcb;
  }
  
  public void a(o paramo, ac paramac, bc parambc, rb paramrb)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    ab localab = this.a.a();
    ArrayList localArrayList = new ArrayList(64);
    int i = 0;
    Object localObject1 = paramo.v();
    do
    {
      do
      {
        if (!((w)localObject1).e()) {
          break;
        }
        localObject2 = parambc.a(((w)localObject1).d());
        if (!bool2)
        {
          if (bool1) {
            break label112;
          }
          i += ((ec)localObject2).c();
          ((w)localObject1).f();
        }
      } while (!bool1);
    } while (bool2);
    label112:
    localObject1 = new int[paramo.j() + i / 2];
    Object localObject2 = new int[paramo.j() + i / 2];
    int j = paramo.j();
    a.c.d[] arrayOfd1 = new a.c.d[i / 2];
    int k = 2;
    int m = 0;
    label152:
    label447:
    label496:
    do
    {
      do
      {
        if (m >= paramac.a()) {
          break label549;
        }
        localObject3 = paramac.a(m);
        if (bool1) {
          break label553;
        }
        int n = 0;
        localObject4 = ((vb)localObject3).c().f();
        do
        {
          if (localObject4 == null) {
            break label536;
          }
          localObject5 = (e)((v)localObject4).c();
          localObject1[localObject5.f()] = m;
          localObject2[localObject5.f()] = n;
          localObject6 = parambc.a((e)localObject5);
          if (bool1) {
            break label152;
          }
          if (((ec)localObject6).c() > 0)
          {
            localObject7 = ((ec)localObject6).b();
            do
            {
              if (localObject7 == null) {
                break label496;
              }
              localObject8 = (a.c.d)((v)localObject7).c();
              if (bool1) {
                break;
              }
              if (((a.c.d)localObject8).e() == localObject5)
              {
                localObject9 = paramo.i();
                localObject10 = parambc.a((a.c.d)localObject8);
                localArrayList.add(localObject9);
                if (!bool2)
                {
                  if (((y)localObject10).l())
                  {
                    paramrb.b((e)localObject9, (e)localObject5, (a.c.d)localObject8, false, true);
                    paramrb.a((e)localObject9, ((a.c.d)localObject8).f(), (a.c.d)localObject8, false, true);
                    k = Math.max(k, ((a.c.d)localObject8).f().d());
                    if (bool2) {
                      break label447;
                    }
                    if (!bool1) {}
                  }
                  else
                  {
                    paramrb.a((e)localObject5, (e)localObject9, (a.c.d)localObject8, true, false);
                    paramrb.b(((a.c.d)localObject8).f(), (e)localObject9, (a.c.d)localObject8, true, false);
                  }
                }
                else {
                  k = Math.max(k, ((a.c.d)localObject8).f().e());
                }
                k = Math.max(2, k);
                localObject2[localObject9.f()] = -1;
                localObject1[localObject9.f()] = (-(m + 1));
                arrayOfd1[(localObject9.f() - j)] = localObject8;
              }
              localObject7 = ((v)localObject7).a();
            } while (!bool1);
          }
          k = Math.max(k, Math.max(((e)localObject5).d(), ((e)localObject5).e()));
          localObject4 = ((v)localObject4).a();
          n++;
          if (bool2) {
            break;
          }
        } while (!bool1);
        m++;
      } while (bool2);
    } while (!bool1);
    label536:
    label549:
    label553:
    byte[] arrayOfByte = new byte[paramo.l()];
    Object localObject3 = new byte[paramo.l()];
    int[] arrayOfInt = new int[paramo.l()];
    Object localObject4 = new int[paramo.l()];
    Object localObject5 = cc.a(paramo, paramac, parambc, (int[])localObject1, (int[])localObject2, arrayOfByte, arrayOfInt, (byte[])localObject3, (int[])localObject4, (byte)1, (byte)0);
    Object localObject6 = ((cc)localObject5).c(true);
    Object localObject7 = ((cc)localObject5).c(false);
    Object localObject8 = ((cc)localObject5).a(true);
    Object localObject9 = ((cc)localObject5).a(false);
    Object localObject10 = cc.a((int[])localObject1, (int[])localObject2, arrayOfByte, arrayOfInt, (byte[])localObject3, (int[])localObject4, (byte)3, (byte)3);
    Comparator localComparator1 = ((cc)localObject10).a(true);
    Comparator localComparator2 = ((cc)localObject10).a(false);
    a.c.d[] arrayOfd2 = new a.c.d[k];
    z localz1 = new z();
    z localz2 = new z();
    int i1 = 0;
    Object localObject11;
    Object localObject12;
    Object localObject13;
    Object localObject14;
    Object localObject15;
    label1068:
    label1151:
    do
    {
      do
      {
        if (i1 >= paramac.a()) {
          break;
        }
        localObject11 = paramac.a(i1);
        int i2 = 0;
        if (bool1) {
          break label3033;
        }
        localObject12 = ((vb)localObject11).c().f();
        do
        {
          if (localObject12 == null) {
            break label2353;
          }
          localObject13 = (e)((v)localObject12).c();
          localObject14 = null;
          if (bool1) {
            break;
          }
          if (this.b.a((e)localObject13)) {
            localObject14 = this.b.a(paramo, (e)localObject13);
          }
          int i3 = parambc.a((e)localObject13).d();
          if ((bool2) || (i3 != 0)) {
            if (!bool2)
            {
              if (i3 != 12) {
                if (bool2) {
                  continue;
                }
              }
            }
            else {
              if (i3 != 13) {
                break label2333;
              }
            }
          }
          localObject15 = new x(paramo.d(localObject13));
          wc localwc1 = ((x)localObject15).c(0);
          wc localwc2 = ((x)localObject15).a(1);
          wc localwc3 = ((x)localObject15).d(3);
          int i5 = 0;
          Object localObject16 = ((e)localObject13).i();
          do
          {
            do
            {
              if (localObject16 == null) {
                break;
              }
              arrayOfd2[(i5++)] = localObject16;
              if (bool2) {
                break label1426;
              }
              localObject16 = ((a.c.d)localObject16).j();
              if (bool1) {
                break label1421;
              }
            } while (!bool1);
          } while (bool2);
          int i7;
          a.c.d locald2;
          Object localObject17;
          if (!bool2)
          {
            if (i5 > 0)
            {
              l.a(arrayOfd2, 0, i5, (Comparator)localObject7);
              l.a(arrayOfd2, 0, i5, (Comparator)localObject9);
              localObject16 = localz1.f();
              int i6 = 0;
              do
              {
                if (i6 >= i5) {
                  break;
                }
                if (bool1) {
                  break label1068;
                }
                if (localObject16 == null) {
                  if (!bool2)
                  {
                    if (localz2.isEmpty())
                    {
                      localObject16 = localz1.b(null);
                      if (bool2) {
                        continue;
                      }
                      if (!bool1) {}
                    }
                    else
                    {
                      localObject16 = localz2.f();
                      localz2.h((v)localObject16);
                    }
                  }
                  else {
                    localz1.a((v)localObject16);
                  }
                }
                ((v)localObject16).a(arrayOfd2[i6]);
                i6++;
                localObject16 = ((v)localObject16).a();
              } while (!bool1);
              if (!bool2) {
                if (localObject16 == null) {}
              }
              while (bool2)
              {
                v localv1 = ((v)localObject16).a();
                localz1.h((v)localObject16);
                localz2.a((v)localObject16);
                localObject16 = localv1;
                if (bool2) {
                  break label1152;
                }
                if (bool1) {
                  break label1151;
                }
                if (!bool1) {
                  break;
                }
                a(localz1, localComparator1, (byte[])localObject3, (int[])localObject4);
                a(paramrb, localz1, localComparator1, (byte[])localObject3, (int[])localObject4, false);
              }
              localObject16 = localz1.f();
              i7 = 0;
              do
              {
                if (localObject16 == null) {
                  break;
                }
                locald2 = (a.c.d)((v)localObject16).c();
                localObject17 = parambc.a(locald2).f();
                if (bool1) {
                  break label3033;
                }
                if (localObject17 != null)
                {
                  if (bool2) {
                    break label1222;
                  }
                  if (!((cd)localObject17).g())
                  {
                    if (bool2) {
                      break label1276;
                    }
                    if (!((cd)localObject17).c()) {
                      break label1271;
                    }
                  }
                }
                if ((bool2) || (localObject17 != null))
                {
                  if (bool2) {
                    break label1263;
                  }
                  if (((cd)localObject17).a()) {}
                }
                else
                {
                  localwc1.a(locald2);
                }
                localObject3[locald2.d()] = 0;
                if (!bool2)
                {
                  if (bool1)
                  {
                    if (!bool2) {
                      if (((cd)localObject17).e())
                      {
                        if (!bool2)
                        {
                          if (!((cd)localObject17).a()) {
                            localwc2.a(locald2);
                          }
                          localObject3[locald2.d()] = 1;
                        }
                        if (bool2) {
                          continue;
                        }
                        if (!bool1) {
                          break label1364;
                        }
                      }
                    }
                    if (bool2) {
                      continue;
                    }
                    if (((cd)localObject17).f())
                    {
                      if (!((cd)localObject17).a()) {
                        localwc3.b(locald2);
                      }
                      localObject3[locald2.d()] = -1;
                    }
                  }
                  localObject4[locald2.d()] = (++i7);
                  localObject16 = ((v)localObject16).a();
                }
              } while (!bool1);
            }
            localwc1 = ((x)localObject15).c(2);
            localwc2 = ((x)localObject15).d(1);
            localwc3 = ((x)localObject15).a(3);
            if (bool2) {
              break label3014;
            }
          }
          i5 = 0;
          localObject16 = ((e)localObject13).h();
          if (localObject16 != null)
          {
            arrayOfd2[(i5++)] = localObject16;
            localObject16 = ((a.c.d)localObject16).i();
          }
          for (;;)
          {
            if (!bool2)
            {
              if (!bool1)
              {
                if (!bool1) {
                  break;
                }
                if (bool2) {
                  continue;
                }
                if (bool2) {
                  break label1942;
                }
                if (i5 > 0)
                {
                  l.a(arrayOfd2, 0, i5, (Comparator)localObject6);
                  l.a(arrayOfd2, 0, i5, (Comparator)localObject8);
                  localObject16 = localz1.f();
                  i7 = 0;
                  do
                  {
                    if (i7 >= i5) {
                      break;
                    }
                    if (bool1) {
                      break label1612;
                    }
                    if (localObject16 == null) {
                      if (!bool2)
                      {
                        if (localz2.isEmpty())
                        {
                          localObject16 = localz1.b(null);
                          if (bool2) {
                            continue;
                          }
                          if (!bool1) {}
                        }
                        else
                        {
                          localObject16 = localz2.f();
                          localz2.h((v)localObject16);
                        }
                      }
                      else {
                        localz1.a((v)localObject16);
                      }
                    }
                    ((v)localObject16).a(arrayOfd2[i7]);
                    i7++;
                    localObject16 = ((v)localObject16).a();
                  } while (!bool1);
                  if (!bool2) {
                    if (localObject16 == null) {}
                  }
                  while (bool2)
                  {
                    v localv2 = ((v)localObject16).a();
                    localz1.h((v)localObject16);
                    localz2.a((v)localObject16);
                    localObject16 = localv2;
                    if (bool2) {
                      break label1696;
                    }
                    if (bool1) {
                      break label1695;
                    }
                    if (!bool1) {
                      break;
                    }
                    a(localz1, localComparator2, arrayOfByte, arrayOfInt);
                    a(paramrb, localz1, localComparator2, arrayOfByte, arrayOfInt, true);
                  }
                  localObject16 = localz1.f();
                  int i8 = 0;
                  do
                  {
                    if (localObject16 == null) {
                      break;
                    }
                    locald2 = (a.c.d)((v)localObject16).c();
                    localObject17 = parambc.a(locald2).d();
                    if (bool1) {
                      break label3033;
                    }
                    if (localObject17 != null)
                    {
                      if (bool2) {
                        break label1766;
                      }
                      if (!((cd)localObject17).g())
                      {
                        if (bool2) {
                          break label1820;
                        }
                        if (!((cd)localObject17).d()) {
                          break label1815;
                        }
                      }
                    }
                    if ((bool2) || (localObject17 != null))
                    {
                      if (bool2) {
                        break label1807;
                      }
                      if (((cd)localObject17).a()) {}
                    }
                    else
                    {
                      localwc1.b(locald2);
                    }
                    arrayOfByte[locald2.d()] = 0;
                    if (!bool2)
                    {
                      if (bool1)
                      {
                        if (!bool2) {
                          if (((cd)localObject17).e())
                          {
                            if (!bool2)
                            {
                              if (!((cd)localObject17).a()) {
                                localwc2.a(locald2);
                              }
                              arrayOfByte[locald2.d()] = 1;
                            }
                            if (bool2) {
                              continue;
                            }
                            if (!bool1) {
                              break label1908;
                            }
                          }
                        }
                        if (bool2) {
                          continue;
                        }
                        if (((cd)localObject17).f())
                        {
                          if (!((cd)localObject17).a()) {
                            localwc3.b(locald2);
                          }
                          arrayOfByte[locald2.d()] = -1;
                        }
                      }
                      arrayOfInt[locald2.d()] = (++i8);
                      localObject16 = ((v)localObject16).a();
                      i8++;
                    }
                  } while (!bool1);
                }
              }
              if (bool2) {
                break label3014;
              }
            }
          }
          int i4 = 0;
          do
          {
            if (i4 >= 4) {
              break;
            }
            localwc2 = ((x)localObject15).a(i4);
            localwc3 = ((x)localObject15).c(i4);
            wc localwc4 = ((x)localObject15).d(i4);
            double d1 = ((x)localObject15).e(i4);
            int i9 = localwc2.a() + localwc3.a() + localwc4.a();
            localObject17 = null;
            wc localwc5 = null;
            wc localwc6 = null;
            if (bool1) {
              break label3033;
            }
            if (localObject14 != null)
            {
              localObject17 = ((j)localObject14).a(i4);
              localwc5 = ((j)localObject14).c(i4);
              localwc6 = ((j)localObject14).d(i4);
              i9 += ((wc)localObject17).a() + localwc5.a() + localwc6.a();
            }
            if (!bool2)
            {
              if (i9 > 0)
              {
                double d2 = a(paramo, parambc, (e)localObject13, i4, d1, i9);
                double d3 = a(paramo, parambc, (e)localObject13, i4, d1, i9, d2);
                localwc2.h(d3);
                localwc3.h(d3);
                localwc4.h(d3);
                if (!bool2)
                {
                  if (localObject14 != null)
                  {
                    ((wc)localObject17).h(d3);
                    ((wc)localObject17).e(d2);
                    localwc5.h(d3);
                    localwc5.e(((wc)localObject17).h());
                    localwc2.e(localwc5.h());
                    localwc6.h(d3);
                    localwc6.e(d2);
                    localwc4.e(localwc6.h());
                    if (bool2) {
                      break label2317;
                    }
                    if (!bool1) {}
                  }
                  else
                  {
                    localwc2.e(d2);
                  }
                }
                else {
                  localwc4.e(d2);
                }
                a(paramo, localwc2, (e)localObject13);
                localwc3.e(localwc2.h());
                a(paramo, localwc3, (e)localObject13);
                a(paramo, localwc4, (e)localObject13);
              }
              i4++;
            }
          } while (!bool1);
          localObject12 = ((v)localObject12).a();
          i2++;
          if (bool2) {
            break label3014;
          }
        } while (!bool1);
        i1++;
      } while (bool2);
    } while (!bool1);
    label1152:
    label1222:
    label1263:
    label1271:
    label1276:
    if (!bool2)
    {
      i1 = 0;
      do
      {
        if (i1 >= localArrayList.size()) {
          break;
        }
        localObject11 = (e)localArrayList.get(i1);
        a.c.d locald1 = arrayOfd1[(localObject11.f() - j)];
        paramo.g(locald1);
        localObject12 = parambc.a(locald1);
        if (bool1) {
          break label3010;
        }
        y localy;
        if (((e)localObject11).e() > 0)
        {
          localObject13 = ((e)localObject11).h();
          localObject14 = ((e)localObject11).j();
          localy = parambc.a((a.c.d)localObject13);
          localObject15 = parambc.a((a.c.d)localObject14);
          if (((a.c.d)localObject13).f() == locald1.e())
          {
            if (!bool2) {
              if (localy.f() != ((y)localObject12).d()) {
                localObject12 = paramrb.a(locald1, true, localy.f());
              }
            }
            if ((bool2) || (((y)localObject15).f() != ((y)localObject12).f())) {
              localObject12 = paramrb.a(locald1, false, ((y)localObject15).f());
            }
            paramo.a(locald1, paramo.q((a.c.d)localObject13));
            paramo.b(locald1, paramo.q((a.c.d)localObject14));
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            if (!bool2) {
              if (((y)localObject15).f() != ((y)localObject12).d()) {
                localObject12 = paramrb.a(locald1, true, ((y)localObject15).f());
              }
            }
            if ((bool2) || (localy.f() != ((y)localObject12).f())) {
              localObject12 = paramrb.a(locald1, false, localy.f());
            }
            paramo.a(locald1, paramo.q((a.c.d)localObject14));
            paramo.b(locald1, paramo.q((a.c.d)localObject13));
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
        }
        else
        {
          localObject13 = ((e)localObject11).i();
          localObject14 = ((e)localObject11).k();
          localy = parambc.a((a.c.d)localObject13);
          localObject15 = parambc.a((a.c.d)localObject14);
          if (((a.c.d)localObject13).e() == locald1.e())
          {
            if (!bool2) {
              if (localy.d() != ((y)localObject12).d()) {
                localObject12 = paramrb.a(locald1, true, localy.d());
              }
            }
            if ((bool2) || (((y)localObject15).d() != ((y)localObject12).f())) {
              localObject12 = paramrb.a(locald1, false, ((y)localObject15).d());
            }
            paramo.a(locald1, paramo.p((a.c.d)localObject13));
            paramo.b(locald1, paramo.p((a.c.d)localObject14));
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            if (!bool2) {
              if (((y)localObject15).d() != ((y)localObject12).d()) {
                localObject12 = paramrb.a(locald1, true, ((y)localObject15).d());
              }
            }
            if ((bool2) || (localy.d() != ((y)localObject12).f())) {
              localObject12 = paramrb.a(locald1, false, localy.d());
            }
            paramo.a(locald1, paramo.p((a.c.d)localObject14));
            paramo.b(locald1, paramo.p((a.c.d)localObject13));
          }
        }
        paramo.f(locald1);
        i1++;
      } while (!bool1);
      if (!bool2) {
        i1 = 0;
      }
    }
    label1364:
    label1766:
    label1908:
    do
    {
      if (i1 >= localArrayList.size()) {
        break;
      }
      localObject11 = (e)localArrayList.get(i1);
      paramo.a((e)localObject11);
      i1++;
    } while (!bool1);
    label1421:
    label1426:
    label1612:
    label3033:
    return;
  }
  
  protected double a(o paramo, bc parambc, e parame, int paramInt1, double paramDouble, int paramInt2)
  {
    if (paramInt2 <= 1) {
      return paramDouble * 0.5D;
    }
    double d1 = b(paramo, parambc, parame, paramInt1, paramDouble, paramInt2);
    if (!d.R) {
      if (d1 == (1.0D / 0.0D)) {
        return paramDouble * 0.5D;
      }
    }
    return d1 * (paramDouble / (paramInt2 - 1 + 2.0D * d1));
  }
  
  protected double a(o paramo, bc parambc, e parame, int paramInt1, double paramDouble1, int paramInt2, double paramDouble2)
  {
    if (paramInt2 <= 1) {
      return 0.0D;
    }
    return (paramDouble1 - 2.0D * paramDouble2) / (paramInt2 - 1);
  }
  
  protected double b(o paramo, bc parambc, e parame, int paramInt1, double paramDouble, int paramInt2)
  {
    fc localfc = parambc.a(parame).m();
    return (d.R) || (localfc != null) ? localfc.a(paramInt1) : this.d;
  }
  
  private static final void a(o paramo, wc paramwc, e parame)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    if ((bool2) || (paramwc.a() > 0))
    {
      v localv = paramwc.b().f();
      label114:
      do
      {
        if (localv == null) {
          break;
        }
        a.c.d locald = (a.c.d)localv.c();
        double d1 = paramwc.d();
        double d2 = 0.0D;
        if (!bool2)
        {
          if (locald.e() == parame) {
            paramo.a(locald, paramwc.a(d1, d2));
          }
        }
        else
        {
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break label114;
          }
        }
        paramo.b(locald, paramwc.a(d1, d2));
        localv = localv.a();
      } while (!bool1);
    }
  }
  
  static final int a(byte paramByte, int paramInt)
  {
    if (!d.R) {
      switch (paramByte)
      {
      case 0: 
      case 3: 
      case 5: 
      case 6: 
      case 7: 
      default: 
        return paramInt;
      case 1: 
        return 0;
      case 4: 
        return 1;
      case 2: 
        return 2;
      }
    }
    return 3;
  }
  
  static final int a(cd paramcd, int paramInt)
  {
    if (!d.R) {
      if (paramcd == null) {
        return paramInt;
      }
    }
    return a(paramcd.b(), paramInt);
  }
  
  private void a(z paramz, Comparator paramComparator, byte[] paramArrayOfByte, int[] paramArrayOfInt)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    label480:
    if ((bool2) || (paramz.size() > 1))
    {
      Object localObject1 = paramz.f();
      int i = -1;
      label254:
      do
      {
        if (i > 1) {
          break;
        }
        Object localObject2 = localObject1;
        do
        {
          do
          {
            if (localObject2 == null) {
              break;
            }
            if (bool2) {
              break label575;
            }
            if (bool1) {
              break label569;
            }
            if (paramArrayOfByte[((a.c.d)localObject2.c()).d()] >= i) {
              break;
            }
            localObject2 = ((v)localObject2).a();
          } while (!bool1);
        } while (bool2);
        if (localObject2 == null) {
          return;
        }
        i = paramArrayOfByte[((a.c.d)localObject2.c()).d()];
        do
        {
          if (!bool2)
          {
            if (paramArrayOfInt[((a.c.d)localObject2.c()).d()] > 0) {
              localObject1 = localObject2;
            }
          }
          else
          {
            if (bool2) {
              break label568;
            }
            if (!bool1) {
              continue;
            }
          }
          Object localObject3 = localObject2;
          int j = 1;
          Object localObject4 = ((v)localObject3).a();
          do
          {
            do
            {
              if (localObject4 == null) {
                break;
              }
              if (bool1) {
                break label254;
              }
              if (paramArrayOfByte[((a.c.d)localObject4.c()).d()] != i) {
                break;
              }
              if (!bool2)
              {
                if (paramArrayOfInt[((a.c.d)localObject4.c()).d()] != 0) {
                  break;
                }
                j++;
                localObject4 = ((v)localObject4).a();
              }
            } while (!bool1);
          } while (bool2);
          if (localObject4 == null) {
            return;
          }
          if (paramArrayOfByte[((a.c.d)localObject4.c()).d()] != i)
          {
            localObject1 = localObject4;
            if (bool2) {
              break label568;
            }
            if (!bool1) {}
          }
          else
          {
            localObject1 = ((v)localObject4).a();
            do
            {
              if (localObject1 == null) {
                break;
              }
              if (bool2) {
                break label575;
              }
              if (bool1) {
                break label569;
              }
              if (paramArrayOfByte[((a.c.d)localObject1.c()).d()] != i) {
                break;
              }
              if (!bool2)
              {
                if (paramArrayOfInt[((a.c.d)localObject1.c()).d()] <= 0) {
                  break;
                }
                localObject1 = ((v)localObject1).a();
              }
            } while (!bool1);
            do
            {
              if (bool2) {
                break label573;
              }
              if (j <= 0) {
                break label561;
              }
              int k = 0;
              Object localObject5 = localObject4;
              int m = 0;
              a.c.d locald = (a.c.d)((v)localObject3).c();
              if (bool1) {
                break;
              }
              Object localObject6 = localObject4;
              do
              {
                do
                {
                  if (localObject6 == localObject1) {
                    break label480;
                  }
                  int n = paramComparator.compare((a.c.d)((v)localObject6).c(), locald);
                  if (bool1) {
                    break;
                  }
                  if (n < 0)
                  {
                    k--;
                    if (bool2) {
                      continue;
                    }
                    if (k < m)
                    {
                      m = k;
                      localObject5 = ((v)localObject6).a();
                      if (bool2) {
                        continue;
                      }
                      if (!bool1) {}
                    }
                  }
                  else
                  {
                    if (bool2) {
                      continue;
                    }
                    if (n > 0) {
                      k++;
                    }
                  }
                  localObject6 = ((v)localObject6).a();
                } while (!bool1);
                localObject6 = localObject3;
                localObject3 = ((v)localObject3).a();
                if (bool2) {
                  break label551;
                }
              } while (bool2);
              if (localObject5 != localObject3)
              {
                if (!bool2)
                {
                  paramz.h((v)localObject6);
                  if (localObject5 == null)
                  {
                    paramz.a((v)localObject6);
                    if (bool2) {
                      continue;
                    }
                    if (!bool1) {
                      break label549;
                    }
                  }
                }
                paramz.a((v)localObject6, (v)localObject5);
              }
              localObject4 = localObject5;
              j--;
            } while (!bool1);
          }
        } while (bool2);
        i = (byte)(i + 1);
      } while (!bool1);
    }
    label549:
    label551:
    label561:
    label568:
    label569:
    label573:
    label575:
    return;
  }
  
  private void a(rb paramrb, z paramz, Comparator paramComparator, byte[] paramArrayOfByte, int[] paramArrayOfInt, boolean paramBoolean)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    label289:
    label450:
    if ((bool2) || (paramz.size() > 1))
    {
      v localv1 = paramz.f();
      int i = 0;
      if (localv1 != null) {}
      while (bool2)
      {
        if (bool1) {
          break label97;
        }
        if (paramArrayOfByte[((a.c.d)localv1.c()).d()] == -2)
        {
          i++;
          localv1 = localv1.a();
          if (!bool1) {
            break;
          }
        }
      }
      if (((!bool2) && (i == 0)) || (i == paramz.size())) {
        label97:
        return;
      }
      v localv2 = paramz.f();
      Object localObject1 = localv1;
      v localv3 = localv2;
      label322:
      do
      {
        Object localObject2;
        a.c.d locald1;
        Object localObject3;
        int i2;
        do
        {
          if (i <= 0) {
            return;
          }
          int j = 0;
          localObject2 = localObject1;
          int k = 0;
          locald1 = (a.c.d)localv3.c();
          int m = -1;
          localObject3 = localObject1;
          do
          {
            if (localObject3 == null) {
              break;
            }
            a.c.d locald2 = (a.c.d)((v)localObject3).c();
            i1 = paramArrayOfByte[locald2.d()];
            i2 = paramComparator.compare(locald2, locald1);
            if (bool1) {
              break label322;
            }
            if (i2 < 0)
            {
              j--;
              if (bool2) {
                continue;
              }
              if (j < k)
              {
                k = j;
                localObject2 = ((v)localObject3).a();
                if (bool2) {
                  continue;
                }
                if (!bool1) {}
              }
            }
            else
            {
              if (!bool2) {
                if (i2 > 0)
                {
                  j++;
                  if (bool2) {
                    continue;
                  }
                  if (!bool1) {
                    break label289;
                  }
                }
              }
              if (bool2) {
                continue;
              }
              if (k == j)
              {
                if (bool2) {
                  continue;
                }
                if (m <= 0)
                {
                  if (bool2) {
                    continue;
                  }
                  if (i1 >= 0) {
                    localObject2 = localObject3;
                  }
                }
              }
            }
            m = i1;
            localObject3 = ((v)localObject3).a();
          } while (!bool1);
          localObject3 = localv3;
          localv3 = localv3.a();
        } while (bool2);
        int n = 0;
        if (!bool2)
        {
          if (localObject2 != localv3) {
            paramz.h((v)localObject3);
          }
        }
        else
        {
          if (!bool2) {
            if (localObject2 == null)
            {
              i1 = paramArrayOfByte[((a.c.d)paramz.g().c()).d()];
              if (!bool2)
              {
                if (i1 > 0) {
                  n = i1;
                }
                paramz.a((v)localObject3);
              }
              if (!bool1) {
                break label528;
              }
            }
          }
          if (((v)localObject2).b() != null)
          {
            i1 = paramArrayOfByte[((a.c.d)localObject2.b().c()).d()];
            if (bool2) {
              break label450;
            }
            if (!bool1) {}
          }
          else
          {
            i1 = -1;
          }
          i2 = paramArrayOfByte[((a.c.d)localObject2.c()).d()];
          paramz.a((v)localObject3, (v)localObject2);
          if (!bool2) {
            if (i1 > 0) {
              n = i1;
            }
          }
          if (!bool2)
          {
            if (i2 >= 0) {
              break label528;
            }
            n = i2;
          }
          if (bool2) {
            break label516;
          }
          if (!bool1) {
            break label528;
          }
        }
        int i1 = paramArrayOfByte[((a.c.d)localObject2.c()).d()];
        if ((bool2) || (i1 < 0)) {
          n = i1;
        }
        if (!bool2) {
          if (bool2) {}
        }
        if (!bool2) {}
        paramrb.a(locald1, paramBoolean, n == 0 ? cd.a((byte)(paramBoolean ? 2 : 1)) : cd.a((byte)(n < 0 ? 8 : 4)));
        paramArrayOfByte[locald1.d()] = n;
        localObject1 = localObject2;
        i--;
      } while (!bool1);
    }
    label516:
    label528:
    return;
  }
  
  public double a()
  {
    return this.d;
  }
  
  public void a(double paramDouble)
  {
    this.d = paramDouble;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.u

 * JD-Core Version:    0.7.0.1

 */